import pandas as pd
import glob
import os

input_directory = "path/to/xlsx/files/"
output_file = "path/to/merged_output.xlsx"

xlsx_files = glob.glob(os.path.join(input_directory, "*.xlsx"))

merged_data = pd.DataFrame()

for file in xlsx_files:
    df = pd.read_excel(file)

    merged_data = pd.concat([merged_data, df], ignore_index=True)

merged_data.to_excel(output_file, index=False)

print(f"合并完成，合并后的文件已保存到 {output_file}")
